let isReg = (str)=>{
    let reg = /[-,//,/,]/
    return reg.test(str)
}

let formTime = (num)=>{
    let str = String(num)
    return str.length < 2 ? '0'+str : str 
}

let getDate = (date)=>{
    let year = date.getFullYear()
    let month = date.getMonth()+1
    let dates = date.getDate()
    return {year,month,dates}
}

export const formDate = (date,arg)=>{
    let {year,month,dates} = getDate(date)

    if(isReg(arg) && arg){
        return `${year}${arg}${formTime(month)}${arg}${formTime(dates)}`
    }
}